<template>
  <div>
    <div class="box">
      <div class="cont">
        <span class="cont-text1">#</span>
        <span class="cont-text2">权限名称</span>
        <span class="cont-text2">路径</span>
        <span class="cont-text2">权限等级</span>
      </div>
      <div class="cont" v-for="(item, index) in rights.list" :key="index">
        <span class="cont-text1">{{ index + 1 }}</span>
        <span class="cont-text2">{{ item.authName }}</span>
        <span class="cont-text2">{{ item.path }}</span>
        <span v-if="item.level==0" class="cont-text2"><el-tag>一级</el-tag></span>
        <span v-else-if="item.level==1" class="cont-text2"><el-tag class="ml-2" type="success">二级</el-tag></span>
        <span v-else-if="item.level==2" class="cont-text2"><el-tag class="ml-2" type="danger">三级</el-tag></span>
      </div>
    </div>
  </div>
</template>
<script setup>
import { ref, reactive } from "vue";
import { putRightslist } from "../tools/ajax";
const rights = reactive({});
putRightslist({ type: "list" }).then((res) => {
  console.log(res);
  rights.list = res.data;
});
</script>
<style scoped lang="less">
.box{
     overflow: auto;
     padding: 20px;
}
.cont {
  display: flex;
  justify-content: space-between;
  text-align: left;
  color: gray;
  line-height: 50px;
  .cont-text1 {
    width: 50px;
    height: 50px;
  }
  .cont-text2 {
    width: 400px;
    height: 50px;
  }
}
</style>